<?php

include('phpmosaic.include.php');

function updateProcessBar ( $percent ) {	
}

// parse images for database

$pmip = new phpMosaicImageParser();
$pmip->includeSubfolders(true);
$pmip->setImageExtensions(array("jpg","jpeg","png","gif","bmp"));
$pmip->setTimeLimit(0);
$pmip->setMemoryLimit(512);
$pmip->setResizeOption('cut');
$pmip->setThumbnailQuality(90);
$pmip->setThumbnailSize(40,30);
$pmip->showErrorMessages(true);
$pmip->parseImageFolder('../pathToFolder','groupname');
echo $pmip->getParsedImages();


// create mosaic image

$pmic = new phpMosaicImageCreator();
$pmic->setThumbnailSize(40,30);
$pmic->enableOptimiser();
$pmic->setDistance(10);
$pmic->setRange(0);
$pmic->setQuality(90);
$pmic->setMemoryLimit(512);
$pmic->setTimeLimit(0);
$pmic->setSourceImageFile('../source_image.jpg');
$pmic->createMosaicImage('../target_image.jpg');


// create mosaic image

$pmic = new phpMosaicImageCreator();
$pmic->setThumbnailSize(40,30);
$pmic->enableOptimiser();
$pmic->setDistance(10);
$pmic->setRange(0);
$pmic->setQuality(90);
$pmic->setMemoryLimit(512);
$pmic->setTimeLimit(0);
$pmic->registerProgressCallback("updateProcessBar");
$pmic->setSourceImageFile('../source_image.jpg');
$pmic->createMosaicImage('../target_image.jpg');

?>